<?php
namespace app\common\validate;

use think\Validate;

class SolutionValidate extends Validate{

    protected $rule = [
        'title'=>'require',    //名称可以相同
        'cover'=>'require',
        'catid'=>'require',
        'desc'=>'require',
        'content'=>'require'
    ];

    protected $message = [
        'title.require'=>'标题必填',
        'cover.require'=>'缺少封面图',
        'desc.require'=>'缺少简介',
        'content.require'=>'缺少详情',
        'catid'=>'请选择分类'
    ];

    protected $scene = [
        'add' => ['title','cover','desc','content','catid'],
        'edit' => ['title','cover','desc','content','catid'],
    ];
}